package com.project.system.domain.entity;

import com.project.common.domain.po.DbBase;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author : [chg]
 * @className : EmployeeSettlementCycle
 * @description : 员工结算周期实体
 * @createTime : [2025/7/9 11:30]
 */
@Entity
@Data
@Table(name = "tb_employee_settlement_cycle")
@org.hibernate.annotations.Table(appliesTo = "tb_employee_settlement_cycle", comment = "员工结算周期")
public class HrEmployeeSettlementCycle extends DbBase {
    @Column(columnDefinition = "bigint DEFAULT NULL COMMENT '用户ID'")
    private Long userId; // 用户ID

    @Column(columnDefinition = "int DEFAULT NULL COMMENT '发薪周期（1-每月,2-半月,3-每周）'")
    private Integer payCycle; // 发薪周期（1-每月,2-半月,3-每周）

    @Column(columnDefinition = "date DEFAULT NULL COMMENT '开始时间'")
    private LocalDate startTime; // 开始时间
    
    @Column(columnDefinition = "date DEFAULT NULL COMMENT '结束时间'")
    private LocalDate endTime; // 结束时间
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '实际出勤天数'")
    private Integer actualAttendanceDays; // 实际出勤天数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '迟到次数'")
    private Integer lateCount; // 迟到次数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '早退次数'")
    private Integer earlyLeaveCount; // 早退次数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '旷工天数'")
    private Integer absentDays; // 旷工天数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '请假总天数'")
    private Integer totalLeaveDays; // 请假总天数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '加班天数'")
    private Integer overtimeDays; // 加班天数
    
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '加班时长'")
    private Integer overtimeMinutes; // 加班时长
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '基本工资'")
    private BigDecimal basicSalary; // 基本工资
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '节假日上班补贴'")
    private BigDecimal holidaySubsidy; // 节假日上班补贴
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '加班工资'")
    private BigDecimal overtimeSalary; // 加班工资
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '当前预支工资'")
    private BigDecimal currentAdvanceSalary; // 当前预支工资
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '当前借款'")
    private BigDecimal currentLoan; // 当前借款
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '本次预支扣款'")
    private BigDecimal advanceDeduction; // 本次预支扣款
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '本次借款扣款'")
    private BigDecimal loanDeduction; // 本次借款扣款
    
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '实发工资'")
    private BigDecimal netSalary; // 实发工资
    //增加扣除金额
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '调整'")
    private BigDecimal deductionAmount;
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '总扣除金额'")
    private BigDecimal totalDeduction;
    //增加节假日或休息日个数 7/5,7/6 字符串
    @Column(columnDefinition = "varchar(500) DEFAULT NULL COMMENT '周期内节假日'")
    private String holidayOrRestDays;
    //增加休息日7/5,7/6
    @Column(columnDefinition = "varchar(500) DEFAULT NULL COMMENT '周期内休息日'")
    private String restDays;
    //员工日新
    @Column(columnDefinition = "decimal(10,2) DEFAULT NULL COMMENT '员工日新'")
    private BigDecimal dailySalary;

    @Column(columnDefinition = "int DEFAULT 0 COMMENT '状态（0-未发，1-已发）'")
    private Integer status; // 状态

    @Column(columnDefinition = "varchar(500) DEFAULT NULL COMMENT '备注'")
    private String remark; // 备注
}